<?php
class logs extends parent_class
{
	public $logs=NULL;
	
	function __construct($load=true)
	{
		if ($load)
		{
			return $this->get();
		}
	}
	
	public function remove()
	{
		$query="DELETE FROM `logs` WHERE 1";
		if (db::$db->query($query))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	public function get($first=0,$last=0)
	{
		$query="SELECT `id` FROM `logs` WHERE 1";
		if ($result=db::$db->query($query))
		{
			if ($result->num_rows>0)
			{
				while ($row=$result->fetch_object())
				{
					$this->logs[]=new log($row->id);
				}
				return true;
			}
			else
			{
				
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	
	public function returnit($str="")
	{
		if ($this->logs)
		{
			$tmp_str="";
			foreach($this->logs as $log)
			{
				$tmp_str.=$log->returnit($str);
			}
			return $tmp_str;
		}
		else
		{
			return false;
		}
	}
}
?>